<template>
  <div>
    {{name}}
  </div>
</template>

<script>
  export default{
    props: {
      name: String
    },
    setup(props,context){
      console.log(`props.name:  ${props.name}`)
      
      const str = '我是子组件'
      const talk = ()=>{
        console.log('我被父组件触发了')
      }
      
      context.emit("talk",'我是子组件，我被触发了')
      
      return{
        str,
        talk
      }
      
    }
  }
</script>

<style>
</style>
